package com.lanou.myapp.help;

import com.lanou.myapp.greendao.DaoSession;
import com.lanou.myapp.greendao.RankingComic;

import java.util.List;

/**
 * Created by dllo on 16/1/22.
 */
public class RankingComicDaoHelper {

    private DaoSession daoSession;
    private static RankingComicDaoHelper instance;

    public static RankingComicDaoHelper getInstance() {
        if (instance == null) {
            instance = new RankingComicDaoHelper();
        }
        return instance;
    }

    public RankingComicDaoHelper() {
        daoSession = com.lanou.myapp.imageloader.BaseApplication.getDaoSession();

    }

    public List<RankingComic> queryAll() {
        return daoSession.getRankingComicDao().loadAll();
    }

    public void deleteAll() {
        daoSession.getRankingComicDao().deleteAll();

    }

    public void addAll(List<RankingComic> datas) {
        daoSession.getRankingComicDao().insertInTx(datas);
    }


}
